Available API's
The following API's are available, the base URL in all cases is:
https://<customer_account>.finansysapps.com/
View a transaction
Extracts the details of a transaction in JSON format.
Item | Values Required |
---|---|
URL (after base) | api/entrymodule/<record_id>/detail |
Method | GET |
Parameters | moduleid: <module_id> |
Headers | x-api-key: <API Key> Accept: */* |
Body | Not required |
Expected Response | Transaction details in JSON format |
Save a transaction
Creates a transaction in draft form.
Item | Values Required |
---|---|
URL (after base) | api/entrymodule/save |
Method | POST |
Parameters | moduleid: <module_id> |
Headers | x-api-key: <API Key> Accept: */* Content-Type: application/json |
Body | Transaction details in JSON format |
Expected Response | { "success": true, "message": "The data has been added.", "data": { "recordId": "8ac22ffb80d547728c880779047bb2f7" } } |
The response contains the record ID of the newly started transaction. This can then be used to submit the transaction. If it is not submitted it will remain in draft form.
To ensure you format the JSON you send in the body correctly, you can extract the details of an existing transaction using the 'View' option above. The format required will be everything within the 'data' section including the curly brackets, but excluding the system fields as these values are generated when the transaction is created.
Submit a transaction
Submits a draft transaction.
Item | Values Required |
---|---|
URL (after base) | api/entrymodule/submit |
Method | POST |
Parameters | moduleid: <module_id> recordid: <record_id> |
Headers | x-api-key: <API Key> Accept: */* Content-Type: application/json |
Body | Not required |
Expected Response | { "success": true, "message": "Data has been submitted", "data": { "instance_id": "fdd4998b8ad44cdea046896af3573748" } } |
The instance_id returned here indicates the stage that the transaction is now at. This is also known as the task_id and is required if you want to use the API to approve the transaction.
Sending a transaction for authorisation is a two stage process. Firstly use the 'save' API to send the transaction details, then use the 'submit' API with the record ID that the 'save' call responded with to submit the transaction and send it on to the next step of the process.
Approve a transaction
Use this on any transaction awaiting approval to move it on to the next step in the process.
Item | Values Required |
---|---|
URL (after base) | api/entrymodule/approve |
Method | POST |
Parameters | None |
Headers | x-api-key: <API Key> Accept: */* Content-Type: application/json |
Body | { "task_id":<task_id> "accepted": true } |
Expected Response | { "success": true, "message": "Data has been submitted", "data": null{ "instance_id": "fdd4998b8ad44cdea046896af3573748" } } |
Get Reference Data By Key
This allows you to get a specific reference data item by searching on the primary key field. The primary key field is always present, it can be entered by the user (but must be unique) or system generated.
Item | Values Required |
---|---|
URL (after base) | api/referencedataentry/getdatabykey |
Method | GET |
Parameters | referencedataid: <reference_data_id> key: <primary_key_value> |
Headers | x-api-key: <API Key> Accept: */* Content-Type: application/json |
Body | Not required |
Expected Response | { "success": true, "message": "", "data": { "field1": "value1", "field1": "value1" ... } } |
Update Reference Data By Key
This allows you to update reference data in a 'create or amend' way based on the primary key. If a record with the supplied primary key exists then the record will be amended with the data supplied, if not a new record will be created. If the data is supplied without a key then a new one will be generated.
Item | Values Required |
---|---|
URL (after base) | api/referencedataentry/keybatch |
Method | POST |
Parameters | referencedataid: <reference_data_id> key: <primary_key_value> |
Headers | x-api-key: <API Key> Accept: */* Content-Type: application/json |
Body | { "field1":"value1", "field2":"value2", ... } |
Expected Response | { "success": true, "message": "Reference Data has been updated...", "data": null } |
Reference Data Bulk Update
This allows you to update multiple reference data items in a single API call. As with the update by key method it works in a 'create or amend' way based on the primary key. If a record with the supplied primary key exists then the record will be amended with the data supplied, if not a new record will be created. If the data is supplied without a key then a new one will be generated.
Item | Values Required |
---|---|
URL (after base) | api/referencedataentry/keybatches |
Method | POST |
Parameters | referencedataid: <reference_data_id> |
Headers | x-api-key: <API Key> Accept: */* Content-Type: application/json |
Body | [ {"key":"value","field1","value1",...}, {"key":"value","field1":"value1",...} ... ] |
Expected Response | { "success": true, "message": null, "data": null } |
Note that the body values must be enclosed in square brackets
Reference Data Lookup
This will enable you to get a list of reference data for a specified reference data ID.
https://<customer_id>.finansysapps.com/referencedata/<reference_data_id>?from=datatable
Item | Values Required |
---|---|
URL (after base) | api/referencedataentry/lookup |
Method | POST |
Parameters | None |
Headers | x-api-key: <API Key> Accept: */* Content-Type: application/json |
Body | { "referenceDataId": "<reference_data_id>", "fieldName": [ "field1", "field2" ... ] } |
Expected Response | { "recordsFiltered": 6, "recordsTotal": 6, "message": "", "data": [ { "field1": "value1", "field2": "value2" },} } |
In this example body 'field1', 'field2' etc. would be replaced by the actual field IDs you want to see. These would usually be the same as the field names but in lower case with spaces and special characters replaced with underscores, but you can check these by going in to the reference data designer and viewing the field properties.
Filters can be added to the reference data lookup to conditionally return only some of the values. The format is as follows:
{
"referenceDataId": "<reference_data_id>",
"fieldName": [
"value1",
"value2"
]
,
"filter":{
"matchesAll":true,
"filters": [
{
"field":"value1",
"operator":"eq",
"value":"filter_value1",
"ignoreCase": true
},
{
"field":"value2",
"operator":"eq",
"value":"filter_value2",
"ignoreCase": true
}
...
]
}
}
-
matchesAll - true for all filters must match (AND condition), false for any condition must match (OR condition)
-
operator - valid values are:
- eq - equal to
- neq - not equal to
- lt - less than
- gt - greater than
- lte - less than or equal to
- gte - greater than or equal to
- contains - filter value is contained in field
- startswith - value begins with filter value
Reference data delete
Deletes one or more rows from a reference data table.
Item | Values Required |
---|---|
URL (after base) | api/referencedataentry/deleterow |
Method | POST |
Parameters | referencedataid: <reference_data_id> |
Headers | x-api-key: <API Key> Accept: */* Content-Type: application/json |
Body | ["<reference_data_id","reference_data_line_id"...>] |
Expected Response | { "success": true, "message": null, "data": null } |